package com.example.toolproject.demo.mapper;

import com.example.toolproject.demo.domain.Answer;
import com.example.toolproject.demo.domain.Question;
import com.example.toolproject.demo.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName QuestionMapper
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-10-26 9:58
 **/
@Mapper
public interface QuestionMapper {


    Integer addQuestion(Question question);

    Integer addAnswer(Answer answer);

    Integer deleteAnswer(@Param("answerId") Integer answerId, @Param("id") Integer userId, @Param("roleId") Integer roleId);

    Integer deleteQuestion(@Param("questionId") Integer questionId);

    void deleteALLAnswer(@Param("questionId") Integer questionId);

    List<Question> getQuestion(@Param("username") String username, @Param("school") String school, @Param("question") String question);

    List<Answer> getAnswer(@Param("questionId") Integer questionId);
}
